package com.skycong.hello77.common.okhttp3;


import android.os.Handler;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

/**
 * 专门处理JSON的回调相应
 * Created by Kiki on 2018/6/15.
 */

public class CommonJsonCallback implements Callback{
   //与服务器返回的字段的一个对应关系
    protected  final String RESULT_CODE = "code";
    protected  final String RESULT_MESSAGE = "message";
    protected  final String RESULT_SUCCESS = "success";

    /**
     * 自定义一些我们常见的一些异常类型
     */
   protected final int NETWORK_ERROR = -1;//网络错误
   protected final int JSON_ERROR = -2;//json解析错误
   protected final int OTHER_ERROR = -3;//其他错误

    private Class<?> mClass;
    private Handler mDeliveryHandler;//进行消息的转发，将子线程的数据转发到UI线程

    @Override
    public void onFailure(Call call, IOException e) {

    }

    @Override
    public void onResponse(Call call, Response response) throws IOException {

    }
}
